package initialize

import (
	"gin-web/config"
	"github.com/ngaut/log"
	"path"
)

func InitLog() {
	if config.Cfg.Log.Path != "" {
		log.SetRotateByDay()
		log.SetHighlighting(false)
		log.SetOutputByName(path.Join(config.Cfg.Log.Path, "api.log"))
	}

	if config.Cfg.Log.Level != "" {
		log.SetLevelByString(config.Cfg.Log.Level)
	}

}